﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.ServiceProcess;
using System.Text;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;

namespace RemotingService
{
    public partial class HorizonRemoting : ServiceBase
    {
        public HorizonRemoting()
        {
            InitializeComponent();
        }

        protected override void OnStart(string[] args)
        {
            TcpChannel channel = new TcpChannel(7890);

            ChannelServices.RegisterChannel(channel, false);
            RemotingConfiguration.RegisterWellKnownServiceType(typeof(RemoteObject.RemoteObject), "ObjectRemoting", WellKnownObjectMode.SingleCall);
        }

        protected override void OnStop()
        {
        }
    }
}
